<?php
declare(strict_types=1);

namespace App\Resource\LotteryTurntable\Record;


use Carbon\Carbon;
use Illuminate\Http\Resources\Json\JsonResource;

class Resource extends JsonResource
{
    public function toArray($request): array
    {
        return [
            "id" => $this->id,
            "text" => "在【{$this->app->name}】获得价值{$this->detail->coin}金币的【{$this->detail->prize->reward->name}】X{$this->count}",
            "created_at" => Carbon::make($this->created_at)->toDateTimeString(),
        ];
    }
}